import {
    AUTH_MENU_ADD,
    AUTH_MENU_DELETE,
    AUTH_MENU_LIST,
    AUTH_MENU_SORT,
    AUTH_MENU_UPDATE
} from '@/config/api'
import {
    IAuthMenu,
    IAuthMenuDeleteParameter,
    IAuthMenuEditParameter,
    IAuthMenuSortParameter
} from '@/types/auth/menu'
import http from '@/utils/http'

export function authMenuList() {
    return http.get<IAuthMenu[]>(AUTH_MENU_LIST)
}

export function authMenuAdd(parameter: IAuthMenuEditParameter) {
    return http.post(AUTH_MENU_ADD, parameter)
}

export function authMenuUpdate(parameter: IAuthMenuEditParameter) {
    return http.post(AUTH_MENU_UPDATE, parameter)
}

export function authMenuDelete(parameter: IAuthMenuDeleteParameter) {
    return http.post(AUTH_MENU_DELETE, parameter)
}

export function authMenuSort(parameter: IAuthMenuSortParameter) {
    return http.post(AUTH_MENU_SORT, parameter)
}
